#include <map>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
#include "tdltypes.h"
#include "sys/soloader.h"
using namespace tdl;

typedef void (*aoo_type)();
typedef int (*boo_type)(int);
typedef string (*coo_type)(int, string&);
typedef make_type_list<aoo_type, boo_type, coo_type>::type fp_typelist;

//////////////////////
int main(int argc, char* argv[])
{
	soloader<fp_typelist> sol;

	sol.initialize("./libtest.so");
	sol.load_sofunc<0>("aoo");
	sol.load_sofunc<1>("boo");
	sol.load_sofunc<2>("coo");

	aoo_type pf1 = sol.get_sofunc<0>();
	pf1();

	cout << sol.call_sofunc<1>(2) << endl;

	cout << sol.call_sofunc<2>(3, string("hello")) << endl;

	sol.release();

	return 0;
}

